#include "Object.h"
#include <stdlib.h>
#include <iostream>

using namespace std;

float *parseVector(ifstream &file, Symbol curToken, Symbol *nToken,
        int num) {
    float *numFill = (float *) calloc(sizeof(float), num);;
    int i;
    curToken = matchToken(file, curToken, LAngle);

    i = 0;
    for (i = 0; i < num; i++) {
        if (curToken.isToken) {
            cout << "expected number, found " << 
            tokenList[curToken.t] << endl;
            exit(1);
        }
        numFill[i] = curToken.num;
        curToken = nextToken(file);
        if (i < num - 1) 
            curToken = matchToken(file, curToken, Comma); 
    }

    curToken = matchToken(file, curToken, RAngle);

    *(nToken) = curToken;
    return numFill;
}

